#ifndef __RENDERVIDEO_H__
#define __RENDERVIDEO_H__
#include "../Predefine.h"
#include "Box2D.h"

#define VER_BUFFER_MAX (50)

class CRenderVideo
{
private:
	CRenderVideo();
	~CRenderVideo();


public:
	// use for b2 drawing
	void DrawPolygonB2(const b2Vec2* vertices, int32 vertexCount, const b2Color& color);

	void DrawSolidPolygonB2(const b2Vec2* vertices, int32 vertexCount, const b2Color& color);

	void DrawCircleB2(const b2Vec2& center, float32 radius, const b2Color& color);

	void DrawSolidCircleB2(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color);

	void DrawSegmentB2(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color);

	//void DrawXForm(const b2XForm& xf);

	//solid
	void DrawTriangle(const core::position2df& pos1, const core::position2df& pos2, const core::position2df& pos3, const video::SColor& color);

	void DrawRectangle(const core::rect<float>& rect, const video::SColor& color, const core::position2df& pos = core::position2df(0, 0));

	void DrawPolygon(const core::position2df* vectices, const video::SColor& color, int indexCount);

	void DrawCircle(const core::position2df& center, const f32& radius, const video::SColor& color, const s32& segement = 16);



	//line
	void DrawLine(const core::position2df& pos1, const core::position2df& pos2, const video::SColor& color);

	void DrawLine(const float x1, const float y1, const float x2, const float y2, const irr::video::SColor &color);

	void DrawTriangleLine(const core::position2df& pos1, const core::position2df& pos2, const core::position2df& pos3, const video::SColor& color);

	void DrawRectangleLine(const core::rect<float>& rect, const video::SColor& color, const core::position2df& pos = core::position2df(0, 0));

	void DrawPolygonLine(const core::position2df* vertices, const video::SColor& color, int indexCount);

	void DrawCircleLine(const core::position2df& center, const f32& radius, const video::SColor& color, const s32& segement = 16);

	static CRenderVideo*	GetInstance();

private:
	static CRenderVideo*	m_pInstance;

	video::S3DVertex		m_Vertices[VER_BUFFER_MAX];
	core::position2df		m_Vertices2D[VER_BUFFER_MAX];
	



};

//void DrawPoint(const b2Vec2& p, float32 size, const b2Color& color);
//void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color);
//
//void DrawString(int x, int y, const char* string, ...);
//void DrawAABB(b2AABB* aabb, const b2Color& color);

#endif//__RENDERVIDEO_H__
